﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace SampleWeb2.Migrations
{
    public partial class Init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "basic_image",
                columns: table => new
                {
                    IMAGE_ID = table.Column<string>(nullable: false),
                    IMAGE_NAME = table.Column<string>(nullable: true),
                    IMAGE_PATH = table.Column<string>(nullable: true),
                    IMAGE_EXE = table.Column<string>(nullable: true),
                    MINE_TYPE = table.Column<string>(nullable: true),
                    CREATE_DATETIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_basic_image", x => x.IMAGE_ID);
                });

            migrationBuilder.CreateTable(
                name: "g_goods",
                columns: table => new
                {
                    GOODS_ID = table.Column<string>(nullable: false),
                    GOODS_NAME = table.Column<string>(nullable: true),
                    SALE_PRICE = table.Column<decimal>(nullable: false),
                    SHELF_ID = table.Column<string>(nullable: true),
                    DETAIL_TEXT_ID = table.Column<string>(nullable: true),
                    ORG_ID = table.Column<string>(nullable: true),
                    CREATE_DATETIME = table.Column<DateTime>(nullable: true),
                    CREATE_USER_ID = table.Column<string>(nullable: true),
                    IS_FREE_SHIPPING = table.Column<string>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    STATUS_DATETIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_g_goods", x => x.GOODS_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant",
                columns: table => new
                {
                    MERCHANT_ID = table.Column<string>(nullable: false),
                    CODE = table.Column<string>(nullable: true),
                    MERCHANT_NAME = table.Column<string>(nullable: true),
                    NOTICE_PHONE = table.Column<string>(nullable: true),
                    CONTRACT_NAME = table.Column<string>(nullable: true),
                    CONTRACT_MOBILE = table.Column<string>(nullable: true),
                    CONTRACT_EMAIL = table.Column<string>(nullable: true),
                    CONTRACT_ADDR = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant", x => x.MERCHANT_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_article",
                columns: table => new
                {
                    ARTICLE_ID = table.Column<string>(nullable: false),
                    COVER_PATH = table.Column<string>(nullable: true),
                    MEDIA_PATH = table.Column<string>(nullable: true),
                    ARTICLE_TYPE = table.Column<int>(nullable: true),
                    ARTICLE_CONTENT = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_article", x => x.ARTICLE_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_card_order",
                columns: table => new
                {
                    CARD_ORDER_ID = table.Column<string>(nullable: false),
                    SHEET = table.Column<string>(nullable: true),
                    VIP_ID = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true),
                    AMOUNT = table.Column<decimal>(nullable: true),
                    ACTUAL_AMOUNT = table.Column<decimal>(nullable: true),
                    PAYED_AMOUNT = table.Column<decimal>(nullable: true),
                    PAYED_TIME = table.Column<DateTime>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    STATUS_TIME = table.Column<DateTime>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_card_order", x => x.CARD_ORDER_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_card_order_item",
                columns: table => new
                {
                    CARD_ORDR_ITEM_ID = table.Column<string>(nullable: false),
                    CARD_ORDER_ID = table.Column<string>(nullable: true),
                    CARD_ID = table.Column<string>(nullable: true),
                    PRICE = table.Column<decimal>(nullable: true),
                    CARD_NAME = table.Column<string>(nullable: true),
                    CARD_TYPE = table.Column<int>(nullable: true),
                    DURATION_LENTH = table.Column<int>(nullable: true),
                    DURATION_TYPE = table.Column<int>(nullable: true),
                    EFFECTIVE_TIMES = table.Column<int>(nullable: true),
                    REMARK = table.Column<string>(nullable: true),
                    SORT = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_card_order_item", x => x.CARD_ORDR_ITEM_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_card_order_pay_rec",
                columns: table => new
                {
                    CARD_ORDER_PAY_REC_ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CARD_ORDER_ID = table.Column<string>(nullable: true),
                    PAY_WAY = table.Column<int>(nullable: true),
                    PAY_AMOUNT = table.Column<decimal>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    PAY_FINISH_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_card_order_pay_rec", x => x.CARD_ORDER_PAY_REC_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_config",
                columns: table => new
                {
                    MERCHANT_ID = table.Column<string>(nullable: false),
                    NOTICE_MOBILE_PHONE = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_config", x => x.MERCHANT_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_recharge_card",
                columns: table => new
                {
                    RECHARGE_CARD_ID = table.Column<string>(nullable: false),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    PRICE = table.Column<decimal>(nullable: true),
                    CARD_NAME = table.Column<string>(nullable: true),
                    CARD_TYPE = table.Column<int>(nullable: true),
                    DURATION_LENTH = table.Column<int>(nullable: true),
                    DURATION_TYPE = table.Column<int>(nullable: true),
                    EFFECTIVE_TIMES = table.Column<int>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    STATUS_TIME = table.Column<DateTime>(nullable: true),
                    REMARK = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_recharge_card", x => x.RECHARGE_CARD_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_role",
                columns: table => new
                {
                    ROLE_ID = table.Column<string>(nullable: false),
                    ROLE_NAME = table.Column<string>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    ROLE_TYPE = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_role", x => x.ROLE_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_service",
                columns: table => new
                {
                    SERVICE_ID = table.Column<string>(nullable: false),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    NAME = table.Column<string>(nullable: true),
                    SCALE_TYPE = table.Column<int>(nullable: true),
                    LIMIT_MIN = table.Column<int>(nullable: true),
                    LIMIT_MAX = table.Column<int>(nullable: true),
                    PAY_WAY = table.Column<int>(nullable: true),
                    REMARK = table.Column<string>(nullable: true),
                    DETAIL = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_service", x => x.SERVICE_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_service_book_rec",
                columns: table => new
                {
                    MERCHANT_BOOK_REC_ID = table.Column<string>(nullable: false),
                    VIP_ID = table.Column<string>(nullable: true),
                    PLAN_ITEM_ID = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true),
                    OPERAT_TIME = table.Column<DateTime>(nullable: true),
                    SIGN_IN_TIME = table.Column<DateTime>(nullable: true),
                    FINISHED_TIME = table.Column<DateTime>(nullable: true),
                    CANCEL_TIME = table.Column<DateTime>(nullable: true),
                    CANCEL_REASON = table.Column<string>(nullable: true),
                    STATUS = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_service_book_rec", x => x.MERCHANT_BOOK_REC_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_service_image",
                columns: table => new
                {
                    SERVICE_IMAGE_ID = table.Column<string>(nullable: false),
                    SERVICE_ID = table.Column<string>(nullable: true),
                    IMAGE_ID = table.Column<string>(nullable: true),
                    SORT = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_service_image", x => x.SERVICE_IMAGE_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_service_plan",
                columns: table => new
                {
                    PLAN_ID = table.Column<string>(nullable: false),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    STATUS_TIME = table.Column<DateTime>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_service_plan", x => x.PLAN_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_service_plan_item",
                columns: table => new
                {
                    PLAN_ITEM_ID = table.Column<string>(nullable: false),
                    SERVICE_ID = table.Column<string>(nullable: true),
                    PLAN_ID = table.Column<string>(nullable: true),
                    COURCE_DATE = table.Column<DateTime>(nullable: true),
                    COURCE_START_TIME = table.Column<DateTime>(nullable: true),
                    COURCE_END_TIME = table.Column<DateTime>(nullable: true),
                    STOP_JOIN_TIME = table.Column<DateTime>(nullable: true),
                    TEACHER_NAME = table.Column<string>(nullable: true),
                    STATUS = table.Column<int>(nullable: true),
                    STATUS_TIME = table.Column<string>(nullable: true),
                    CREATE_DATETIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_service_plan_item", x => x.PLAN_ITEM_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_staff",
                columns: table => new
                {
                    STAFF_ID = table.Column<string>(nullable: false),
                    USER_ID = table.Column<string>(nullable: true),
                    STAFF_TYPE = table.Column<int>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_staff", x => x.STAFF_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_staff_role",
                columns: table => new
                {
                    ROLE_ID = table.Column<string>(nullable: false),
                    ROLE_NAME = table.Column<string>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_staff_role", x => x.ROLE_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_vip",
                columns: table => new
                {
                    VIP_ID = table.Column<string>(nullable: false),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    WX_OPEN_ID = table.Column<string>(nullable: true),
                    USER_ID = table.Column<string>(nullable: true),
                    EXPERIRE_TIME = table.Column<DateTime>(nullable: true),
                    REMAIN_TIMES = table.Column<int>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_vip", x => x.VIP_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_vip_clock_rec",
                columns: table => new
                {
                    CLOCK_REC_ID = table.Column<string>(nullable: false),
                    VIP_ID = table.Column<string>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_vip_clock_rec", x => x.CLOCK_REC_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_vip_rechage_rec",
                columns: table => new
                {
                    RECHAGE_REC_ID = table.Column<string>(nullable: false),
                    VIP_ID = table.Column<string>(nullable: true),
                    SOURCE_TYPE = table.Column<int>(nullable: true),
                    SOURCE_ID = table.Column<string>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    RECHAGE_TYPE = table.Column<int>(nullable: true),
                    EFFECTIVE_TIMES = table.Column<int>(nullable: true),
                    DURATION = table.Column<int>(nullable: true),
                    DURATION_TYPE = table.Column<int>(nullable: true),
                    RECHAGE_WAY = table.Column<int>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_vip_rechage_rec", x => x.RECHAGE_REC_ID);
                });

            migrationBuilder.CreateTable(
                name: "merchant_vip_reduce_rec",
                columns: table => new
                {
                    REDUCE_REC = table.Column<string>(nullable: false),
                    VIP_ID = table.Column<string>(nullable: true),
                    SOURCE_TYPE = table.Column<int>(nullable: true),
                    SOURCE_ID = table.Column<string>(nullable: true),
                    MERCHANT_ID = table.Column<string>(nullable: true),
                    RECHAGE_TYPE = table.Column<int>(nullable: true),
                    EFFECTIVE_TIMES = table.Column<int>(nullable: true),
                    DURATION = table.Column<int>(nullable: true),
                    DURATION_TYPE = table.Column<int>(nullable: true),
                    RECHAGE_WAY = table.Column<int>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_merchant_vip_reduce_rec", x => x.REDUCE_REC);
                });

            migrationBuilder.CreateTable(
                name: "system_menu",
                columns: table => new
                {
                    MENU_ID = table.Column<string>(nullable: false),
                    CODE = table.Column<string>(nullable: true),
                    NAME = table.Column<string>(nullable: true),
                    URL = table.Column<string>(nullable: true),
                    SORT = table.Column<int>(nullable: false),
                    PARENT_ID = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_system_menu", x => x.MENU_ID);
                });

            migrationBuilder.CreateTable(
                name: "system_menu_operate",
                columns: table => new
                {
                    OPER_ID = table.Column<string>(nullable: false),
                    NAME = table.Column<string>(nullable: true),
                    MENU_ID = table.Column<string>(nullable: true),
                    SORT = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_system_menu_operate", x => x.OPER_ID);
                });

            migrationBuilder.CreateTable(
                name: "system_user",
                columns: table => new
                {
                    USER_ID = table.Column<string>(nullable: false),
                    USER_NAME = table.Column<string>(nullable: true),
                    TEL = table.Column<string>(nullable: true),
                    REAL_NAME = table.Column<string>(nullable: true),
                    NICK_NAME = table.Column<string>(nullable: true),
                    PASSWORD = table.Column<string>(nullable: true),
                    CREATE_TIME = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_system_user", x => x.USER_ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "basic_image");

            migrationBuilder.DropTable(
                name: "g_goods");

            migrationBuilder.DropTable(
                name: "merchant");

            migrationBuilder.DropTable(
                name: "merchant_article");

            migrationBuilder.DropTable(
                name: "merchant_card_order");

            migrationBuilder.DropTable(
                name: "merchant_card_order_item");

            migrationBuilder.DropTable(
                name: "merchant_card_order_pay_rec");

            migrationBuilder.DropTable(
                name: "merchant_config");

            migrationBuilder.DropTable(
                name: "merchant_recharge_card");

            migrationBuilder.DropTable(
                name: "merchant_role");

            migrationBuilder.DropTable(
                name: "merchant_service");

            migrationBuilder.DropTable(
                name: "merchant_service_book_rec");

            migrationBuilder.DropTable(
                name: "merchant_service_image");

            migrationBuilder.DropTable(
                name: "merchant_service_plan");

            migrationBuilder.DropTable(
                name: "merchant_service_plan_item");

            migrationBuilder.DropTable(
                name: "merchant_staff");

            migrationBuilder.DropTable(
                name: "merchant_staff_role");

            migrationBuilder.DropTable(
                name: "merchant_vip");

            migrationBuilder.DropTable(
                name: "merchant_vip_clock_rec");

            migrationBuilder.DropTable(
                name: "merchant_vip_rechage_rec");

            migrationBuilder.DropTable(
                name: "merchant_vip_reduce_rec");

            migrationBuilder.DropTable(
                name: "system_menu");

            migrationBuilder.DropTable(
                name: "system_menu_operate");

            migrationBuilder.DropTable(
                name: "system_user");
        }
    }
}
